eliminate some uneccessary passing by value in favor of pass by const reference....
authortsteven4 <tsteven4@users.noreply.github.com>
Tue, 3 Jul 2018 20:54:00 +0000 (14:54 -0600)
committerGitHub <noreply@github.com>
Tue, 3 Jul 2018 20:54:00 +0000 (14:54 -0600)
defs.h
main.cc
src/core/datetime.h
waypt.cc

diff --git a/defs.h b/defs.h
index eb5a0be1070b002b1c0b9905e2061de6d54e6ecf..cc2c48e5bf73141bf2fd70dcc88910fb9a4ec3f2 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -548,8 +548,8 @@ public:
   const QList<UrlLink> GetUrlLinks() const;
   void AddUrlLink(const UrlLink& l);
   QString CreationTimeXML() const;
-  gpsbabel::DateTime  GetCreationTime() const;
-  void SetCreationTime(gpsbabel::DateTime t);
+  gpsbabel::DateTime GetCreationTime() const;
+  void SetCreationTime(const gpsbabel::DateTime& t);
   void SetCreationTime(time_t t);
   void SetCreationTime(time_t t, int ms);
   geocache_data* AllocGCData();
diff --git a/main.cc b/main.cc
index 622ae8076083a228818642b71886fdc887a07f52..57384b5d2f9fee38351d4f9719c536d5adaa3eb5 100644 (file)
--- a/main.cc
+++ b/main.cc
@@ -57,7 +57,7 @@ public:
   QargStackElement()
     = default;
 
-  QargStackElement(int p_argn, QStringList p_qargs)
+  QargStackElement(int p_argn, const QStringList& p_qargs)
   {
     argn = p_argn;
     qargs = p_qargs;
index 518346b9f3cc94e5b2ab51013b947b20b9a2b7ee..c4a8299b2c3c52471dfdc8c08f645fb045f375db 100644 (file)
@@ -46,8 +46,8 @@ public:
     setTime_t(0);
   }
 
-  DateTime(QDate date, QTime time) : QDateTime(date, time) {}
-  DateTime(QDateTime dt) : QDateTime(dt) {}
+  DateTime(const QDate& date, const QTime& time) : QDateTime(date, time) {}
+  DateTime(const QDateTime& dt) : QDateTime(dt) {}
 
   // TODO: this should go away in favor of .addSecs().
   // add time_t without losing any existing milliseconds.
index a0b13bd5b4948eed5560a1764ba4cd9d77c74387..825f68b530ffad12e2e5b3fcf5f6a0fea77d8fce 100644 (file)
--- a/waypt.cc
+++ b/waypt.cc
@@ -706,7 +706,7 @@ Waypoint::GetCreationTime() const
 }
 
 void
-Waypoint::SetCreationTime(gpsbabel::DateTime t)
+Waypoint::SetCreationTime(const gpsbabel::DateTime& t)
 {
   creation_time = t;
 }